package net.ersiner.dmtools.csvmatricizer;

/**
 * Holds side information upon executing {@link CsvMatricizer#matricize(Readable, Appendable)}.
 * 
 * @author <a href="http://ersiner.net">Ersin Er</a>
 */
public class MatricizationResult {
    
    private final int numberOfInstances;
    private final int numberOfUniqueAttributes;
    
    /**
     * Creates a {@link MatricizationResult} instance.
     * 
     * @param numberOfInstances
     * @param numberOfUniqueAttributes
     */
    public MatricizationResult(int numberOfInstances, int numberOfUniqueAttributes) {
        this.numberOfInstances = numberOfInstances;
        this.numberOfUniqueAttributes = numberOfUniqueAttributes;
    }

    public int getNumberOfInstances() {
        return numberOfInstances;
    }

    public int getNumberOfUniqueAttributes() {
        return numberOfUniqueAttributes;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + numberOfInstances;
        result = prime * result + numberOfUniqueAttributes;
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        MatricizationResult other = (MatricizationResult) obj;
        if (numberOfInstances != other.numberOfInstances)
            return false;
        if (numberOfUniqueAttributes != other.numberOfUniqueAttributes)
            return false;
        return true;
    }

}
